import { createApp } from 'vue'
//引入组件
import App from './App.vue'
//引入资源
import router from './router'
import store from './store'
import { ConfigProvider } from 'vant';
import errorPlugin from './plugins/errorhandler-plugin'


//创建app
const app=createApp(App)
//注入路由
app.use(router)
//注入状态
app.use(store)

app.use(ConfigProvider);

/**
 * 全局异常处理，将所有没有捕获的异常统一显示出来
 */
 app.use(errorPlugin, {
    // eslint-disable-next-line no-unused-vars
    errorHandler: (error, vm, _info) => {
      // console.error(error)
      store.commit('notification/setException', error)
    }
  })



//挂载实例
app.mount('#app')
